home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C++ für Kids
/
C++ for kids.iso
/
SETUP
/
US
/
CBUILDER
/
DATA.Z
/
MAPI.PAS
< prev
next >
Wrap
Pascal/Delphi Source File
|
1997-02-13
|
19KB
|
497 lines
{*******************************************************}
{ }
{ Delphi Runtime Library }
{ Simple MAPI Interface Unit }
{ }
{ Copyright (c) 1996 Borland International }
{ }
{*******************************************************}
unit Mapi;
interface
uses Windows;
{
Messaging Applications Programming Interface.
Purpose:
This file defines the structures and constants used by that
subset of the Messaging Applications Programming Interface
which is supported under Windows by Microsoft Mail for PC
Networks version 3.x.
}
type
FLAGS = Cardinal;
{$nonamespace FLAGS}
LHANDLE = Cardinal;
{$nonamespace LHANDLE}
PLHANDLE = ^Cardinal;
const
lhSessionNull = (0);
type
PMapiFileDesc = ^TMapiFileDesc;
MapiFileDesc = packed record
ulReserved: Cardinal; { Reserved for future use (must be 0) }
flFlags: Cardinal; { Flags }
nPosition: Cardinal; { character in text to be replaced by attachment }
lpszPathName: LPSTR; { Full path name of attachment file }
lpszFileName: LPSTR; { Original file name (optional) }
lpFileType: Pointer; { Attachment file type (can be lpMapiFileTagExt) }
end;
{$nonamespace MapiFileDesc}
TMapiFileDesc = MapiFileDesc;
const
MAPI_OLE = $00000001;
MAPI_OLE_STATIC = $00000002;
type
PMapiFileTagExt = ^TMapiFileTagExt;
MapiFileTagExt = packed record
ulReserved: Cardinal; { Reserved, must be zero. }
cbTag: Cardinal; { Size (in bytes) of }
lpTag: PByte; { X.400 OID for this attachment type }
cbEncoding: Cardinal; { Size (in bytes) of }
lpEncoding: PByte; { X.400 OID for this attachment's encoding }
end;
{$nonamespace MapiFileTagExt}
TMapiFileTagExt = MapiFileTagExt;
PMapiRecipDesc = ^TMapiRecipDesc;
MapiRecipDesc = packed record
ulReserved: Cardinal; { Reserved for future use }
ulRecipClass: Cardinal; { Recipient class }
{ MAPI_TO, MAPI_CC, MAPI_BCC, MAPI_ORIG }
lpszName: LPSTR; { Recipient name }
lpszAddress: LPSTR; { Recipient address (optional) }
ulEIDSize: Cardinal; { Count in bytes of size of pEntryID }
lpEntryID: Pointer; { System-specific recipient reference }
end;
{$nonamespace MapiRecipDesc}
TMapiRecipDesc = MapiRecipDesc;
const
MAPI_ORIG = 0; { Recipient is message originator }
MAPI_TO = 1; { Recipient is a primary recipient }
MAPI_CC = 2; { Recipient is a copy recipient }
MAPI_BCC = 3; { Recipient is blind copy recipient }
type
PMapiMessage = ^TMapiMessage;
MapiMessage = packed record
ulReserved: Cardinal; { Reserved for future use (M.B. 0) }
lpszSubject: LPSTR; { Message Subject }
lpszNoteText: LPSTR; { Message Text }
lpszMessageType: LPSTR; { Message Class }
lpszDateReceived: LPSTR; { in YYYY/MM/DD HH:MM format }
lpszConversationID: LPSTR; { conversation thread ID }
flFlags: FLAGS; { unread,return receipt }
lpOriginator: PMapiRecipDesc; { Originator descriptor }
nRecipCount: Cardinal; { Number of recipients }
lpRecips: PMapiRecipDesc; { Recipient descriptors }
nFileCount: Cardinal; { # of file attachments }
lpFiles: PMapiFileDesc; { Attachment descriptors }
end;
{$nonamespace MapiMessage}
TMapiMessage = MapiMessage;
const
MAPI_UNREAD = $00000001;
MAPI_RECEIPT_REQUESTED = $00000002;
MAPI_SENT = $00000004;
{ Entry points. }
{ flFlags values for Simple MAPI entry points. All documented flags are
shown for each call. Duplicates are commented out but remain present
for every call. }
{ MAPILogon() flags. }
MAPI_LOGON_UI = $00000001; { Display logon UI }
MAPI_PASSWORD_UI = $00020000; { prompt for password only }
MAPI_NEW_SESSION = $00000002; { Don't use shared session }
MAPI_FORCE_DOWNLOAD = $00001000; { Get new mail before return }
MAPI_ALLOW_OTHERS = $00000008; { Make this a shared session }
MAPI_EXPLICIT_PROFILE = $00000010; { Don't use default profile }
MAPI_EXTENDED = $00000020; { Extended MAPI Logon }
MAPI_USE_DEFAULT = $00000040; { Use default profile in logon }
MAPI_SIMPLE_DEFAULT = MAPI_LOGON_UI or MAPI_FORCE_DOWNLOAD or MAPI_ALLOW_OTHERS;
MAPI_SIMPLE_EXPLICIT = MAPI_NEW_SESSION or MAPI_FORCE_DOWNLOAD or MAPI_EXPLICIT_PROFILE;
{ MAPILogoff() flags. }
MAPI_LOGOFF_SHARED = $00000001; { Close all shared sessions }
MAPI_LOGOFF_UI = $00000002; { It's OK to present UI }
{ MAPISendMail() flags. }
{ #define MAPI_LOGON_UI 0x00000001 Display logon UI }
{ #define MAPI_NEW_SESSION 0x00000002 Don't use shared session }
MAPI_DIALOG = $00000008; { Display a send note UI }
{ # define MAPI_USE_DEFAULT 0x00000040 Use default profile in logon }
{ MAPIFindNext() flags. }
MAPI_UNREAD_ONLY = $00000020; { Only unread messages }
MAPI_GUARANTEE_FIFO = $00000100; { use date order }
MAPI_LONG_MSGID = $00004000; { allow 512 char returned ID }
{ MAPIReadMail() flags. }
MAPI_PEEK = $00000080; { Do not mark as read. }
MAPI_SUPPRESS_ATTACH = $00000800; { header + body, no files }
MAPI_ENVELOPE_ONLY = $00000040; { Only header information }
MAPI_BODY_AS_FILE = $00000200;
{ MAPISaveMail() flags. }
{ #define MAPI_LOGON_UI 0x00000001 Display logon UI }
{ #define MAPI_NEW_SESSION 0x00000002 Don't use shared session }
{ #define MAPI_LONG_MSGID 0x00004000 /* allow 512 char returned ID }
{ MAPIAddress() flags. }
{ #define MAPI_LOGON_UI 0x00000001 Display logon UI }
{ #define MAPI_NEW_SESSION 0x00000002 Don't use shared session }
{ MAPIDetails() flags. }
{ #define MAPI_LOGON_UI 0x00000001 Display logon UI }
{ #define MAPI_NEW_SESSION 0x00000002 Don't use shared session }
MAPI_AB_NOMODIFY = $00000400; { Don't allow mods of AB entries }
{ MAPIResolveName() flags. }
{ #define MAPI_LOGON_UI 0x00000001 Display logon UI }
{ #define MAPI_NEW_SESSION 0x00000002 Don't use shared session }
{ #define MAPI_DIALOG 0x00000008 Prompt for choices if ambiguous }
{ #define MAPI_AB_NOMODIFY 0x00000400 Don't allow mods of AB entries }
type
PFNMapiLogon = ^TFNMapiLogOn;
TFNMapiLogOn = function(ulUIParam: Cardinal; lpszProfileName: LPSTR;
lpszPassword: LPSTR; flFlags: FLAGS; ulReserved: Cardinal;
lplhSession: PLHANDLE): Cardinal stdcall;
PFNMapiLogOff = ^TFNMapiLogOff;
TFNMapiLogOff = function(lhSession: LHANDLE; ulUIParam: Cardinal; flFlags: FLAGS;
ulReserved: Cardinal): Cardinal stdcall;
PFNMapiSendMail = ^TFNMapiSendMail;
TFNMapiSendMail = function(lhSession: LHANDLE; ulUIParam: Cardinal;
var lpMessage: TMapiMessage; flFlags: FLAGS;
ulReserved